import Mock from 'mockjs';
const LoginUsers = [
	{
		id: 1,
		username: 'admin',
		password: '123456',
		avatar: 'https://raw.githubusercontent.com/taylorchen709/markdown-images/master/vueadmin/user.png',
		name: '超级管理员'
	},
	{
		id: 2,
		username: 'zf',
		password: '111111',
		avatar: 'https://raw.githubusercontent.com/taylorchen709/markdown-images/master/vueadmin/user.png',
		name: '管理员'
	}
];
// 策略分析
const Users = [];
for (let i = 0; i < 106; i++) {
	Users.push(Mock.mock({
		id: Mock.Random.guid(),
		name: Mock.Random.cname(),
		'desc|1':['变电站','气压站','交边器','等等等'],
		'rule|1':['"effect":"awd"','"aaqas":"awd"','"fdfbd":"awd"','"efdda":"awd"'],
		add_time: Mock.Random.date(),
		update_time: Mock.Random.date('yyyy-MM-dd'),
	}));
}

// 报警信息
const Dashboard = [];
for (let i = 0; i < 86; i++) {
	Dashboard.push(Mock.mock({
		id: Mock.Random.guid(),
		'desc|1':['在线','掉线'],
		'age|1-4': 1, //随机生成一个数字 大小在1到4
		'news|1':['设备AA掉线了','设备BB掉线了','设备CC掉线了'],
		add_time: Mock.Random.date(),
	}));
}
// 产品管理
const products_manage = [];
for (let i = 0; i < 188; i++) {
	products_manage.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['读写器11','读写器22','读写器33'],
		'desc|1':['读写器a','读写器b'],
		'rule|1':['json'],
		'grna|1':['iot:username:product:'],
		'grnb|1':['0001'],
		'describe|1':['物联描述'],
		'sort|1':['读写器','传感器'],
		'strategy|1':['RFID策略','读写器策略'],
	}));
}
// 设备管理
const products_list = [];
for (let i = 0; i < 13; i++) {
	products_list.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['读写器11','读写器22','读写器33'],
		add_time: Mock.Random.date(),
		upline: Mock.Random.date(),
		'bandState|1':['是','否'],
		'state|1':['在线','离线','未启用'],
		'describe|1':['设备描述'],
		'rule|1':['json'],
		'level|1':['一级','二级','三级','四级','五级'],
	}));
}
// 接口列表
const products_stable = [];
for (let i = 0; i < 63; i++) {
	products_stable.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['访问日志接口','api接口','文档访问接口'],
		'address|1':['/#/products/stable','/#/products/list'],
		'state|1':['已发布','未发布'],
		'date|1':['2018-1-2','2018-3-5'],	
	}));
}
// 产品驱动
const products_drive = [];
for (let i = 0; i < 53; i++) {
	products_drive.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['变压器','路灯'],
		'version|1-3.2':1, //1-3 中随机生成一个保留两位小数点
		'address|1':['http://localhost:8081/#/products/stable','http://localhost:8088/#/products/list'],
		'desc|1':['这是变压器空开的驱动','这是路灯的开关驱动'],
	}));
}
// 应用授权
const apply_add3 = [];
for (let i = 0; i < 60; i++) {
	apply_add3.push(Mock.mock({
		id: Mock.Random.guid(),
		'type|1':['文档接口','后台接口'],
		'path|1':['./post/header','./get/footer'],
		'group|1':['api组','文档组'],
		'state|1':['未授权','已授权'],
		'time|1':['2018-3-4','2018-3-23','2018-2-4'],
	}));
}
// 应用使用详情1
const accountZhangHu = [];
for (let i = 0; i < 34; i++) {
	accountZhangHu.push(Mock.mock({
		id: Mock.Random.guid(),
		name: Mock.Random.cname(),
		createTime: Mock.Random.date(),
		tel:/^1[0-9]{10}$/,
		email:Mock.mock('@EMAIL()'),
		'name|1':['应用1','应用3','应用5'],
		user: Mock.Random.cname(),
		'visitNum|1':['23','53','45','29'],
		'rate|1':['23%','45%','29%'],
		'visitNum|1':['23','53','45','29'],
		'average|1':['3','5','4','9'],
		'useTime|1':['3.4','4.0'],
		'state|1':['200','404'],
		'time|1':['2018/2/23 8:34:34','2018/1/23 18:32:44']
	}));
}
// 消息测试
const news = [];
for (let i = 0; i < 13; i++) {
	news.push(Mock.mock({
		id: Mock.Random.guid(),
		'topic|1':[' topic:hellotopic',' topic:wordtopic'],
		date: Mock.Random.date(),
		'test|1':['消息','警告','报警'],
		'GRN|1':['GRN1','GRN2','GRN3'],
	}));
}
//应用使用情况
const business_log = [];
for (let i = 0; i < 13; i++) {
	business_log.push(Mock.mock({
		id: Mock.Random.guid(),
		time: Mock.Random.date(),
		'name|1':['应用662','应用66','应用6'],
		'impowerNum|1':['23','17','41'],
		'callNum|1':['5','12','9'],
		'visitNum|1':['67','49','29','94'],
		'rate|1':['67%','29%','94%'],
		user: Mock.Random.cname(),
	}));
}
// 接口访问详情
const device_event = [];
for (let i = 0; i < 43; i++) {
	device_event.push(Mock.mock({
		id: Mock.Random.guid(),
		date: Mock.Random.date(),
		'name|1':['读卡器','启动器'],
		'time|1':['23','12','9','35'],
		'rate|1':['34%','43%','56%'],
		'average|1':['4','2','5'],
	}));
}
// 接口访问详情日志
const device_event2 = [];
for (let i = 0; i < 15; i++) {
	device_event2.push(Mock.mock({
		id: Mock.Random.guid(),
		date: Mock.Random.date(),
		'name|1':['读卡器2','启动器2'],
		'time|1':['23','12','9','35'],
		'rate|1':['34%','43%','56%'],
		'average|1':['4','2','5'],
	}));
}
//访问监控
const device_list = [];
for (let i = 0; i < 12; i++) {
	device_list.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['读卡器','启动器'],
		'path|1':['../user/home','../user/footer'],
		'number|1':['4','2','5'],
		'time|1':['4','8','1'],
		'rate|1':['50%','45%'],
		'max|1':['5','6'],
		'min|1':['1','2'],
		'average|1':['3','4'],
	}));
}
// 规则管理
const rules_manage = [];
for (let i = 0; i < 8; i++) {
	rules_manage.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['test1','test2','test3'],
		'state|1':['未启动','已启动'],
		'format|1':['JSON'],
		'desc|1':['这是一个测试'],
		date: Mock.Random.date(),
	}));
}
// 转发数据
const Forwarding_data = [];
for (let i = 0; i <8; i++) {
	Forwarding_data.push(Mock.mock({
		id: Mock.Random.guid(),
		'msg|1':['转发至另外的TOPIC:','转发至MYSQL:'],
		'topic|1':['test11','test22'],
		'mysql|1':['mysql11/','mysql22/'],
		'table|1':['table11','table22'],
	}));
}
// 应用列表
const apply_list = [];
for (let i = 0; i < 34; i++) {
	apply_list.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['应用名称1','应用名称2','应用名称3'],
		'key1|1':['1254334','2342353'],
		'key2|1':['4321','8765'],
		'img|1':['../../../static/img/apply/sunrise.png','../../../static/img/apply/hill.png'],
		'input|1':['移动应用','安卓应用'],
		'state|1':['已授权','未授权']
	}));
}
// 应用授权
const apply_add1 = [];
for (let i = 0; i < 1; i++) {
	apply_add1.push(Mock.mock({
		id: Mock.Random.guid(),
		'name|1':['展示应用','增加应用','删除应用'],
		'key1|1':['1234','5678'],
		'key2|1':['4321','8765'],
		'img|1':['../../../static/img/apply/sunrise.png','../../../static/img/apply/hill.png'],
		'input|1':['移动应用','安卓应用'],
		'limition|1':['查看操作日志','创建应用'],
		'limition2|1':['查看日志','操作日志']
	}));
}
export { LoginUsers,apply_add1,apply_list,Forwarding_data,rules_manage,device_event,device_list, business_log,Users, Dashboard,news,
	products_manage,products_list,products_stable,products_drive,apply_add3,accountZhangHu };
